﻿
<template>
    <div>
        <el-select placeholder="请选择老师,输入关键字搜索" v-if="isdx!=''" size="mini" v-model="pzoption.value" class="form-control filter" style="height: 34px;padding:0px" filterable clearable>
            <el-option v-for="item in dataset"
                       :key="item.jsdm"
                       :label="item.sm"
                       :value="item.jsdm">
            </el-option>
        </el-select>
        <el-cascader :options="dataset" v-model="pzoption.value" v-if="isdx==''" style="height: 34px;padding:0px;min-width:340px" size="mini" :props="props" collapse-tags filterable clearable></el-cascader>
    </div>
</template>

<script>
    module.exports = {
        props: ['pzoption', 'isdx'],
        data() {
            return {
                dataset: [],
                props: {
                    multiple: true,
                    value: "jsdm",
                    label: "jsmc"
                },
            };
        },
        mounted: function () {
            var chi = this;
            chi.$nextTick(function () {
                $.getJSON('/API/VIEWAPI.ashx?Action=QJJW_GETJSDATA', {}, function (resultData) {
                    if (!resultData.ErrorMsg) {
                        if (chi.isdx == "") {
                            chi.dataset = resultData.Result1;
                        } else {
                            chi.dataset = resultData.Result;
                        }

                    }
                })


            })

        }
    };
</script>